package com.daqian.mall.exception;

public class ServiceException extends RuntimeException {

    static final long serialVersionUID = -312124233541251251L;

    public static int SHOW_ERROR = 1;
    public static int HIDE_ERROR = -1;

    public ServiceException() {
        super();
    }

    public ServiceException(String message) {
        super(message);
        this.code = SHOW_ERROR;
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
    }

    public ServiceException(Throwable cause) {
        super(cause);
    }

    protected ServiceException(String message, Throwable cause,
                               boolean enableSuppression,
                               boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    private int code;

    public int getCode() {
        return code;
    }

    public ServiceException(int code, String message) {
        super(message);
        this.code = code;
    }
}
